package com.bjesc_b2c.app.appraiset.adapter;

import android.content.Context;

import com.bjesc_b2c.app.appraiset.R;

import java.util.List;

import app.pinggushi.bjesc.com.baserecyclerview.adapter.CommonAdapter;
import app.pinggushi.bjesc.com.baserecyclerview.adapter.base.ViewHolder;
import master_bean.CountryVariousCityBean;

/**
 * Created by Jason Chen on 2017/2/23.
 */

public class AreaAdapter extends CommonAdapter<CountryVariousCityBean.CityBean.AreaBean> {


    public AreaAdapter(Context context, int layoutId, List<CountryVariousCityBean.CityBean.AreaBean> datas) {
        super(context, layoutId, datas);

    }

    @Override
    protected void convertView(ViewHolder holder, CountryVariousCityBean.CityBean.AreaBean bean, int position) {

        holder.setText(R.id.tv_city_name, bean.getArea());
        if(position == 0){
            holder.setVisible(R.id.tv_letter, true);
        }else{
            holder.setVisible(R.id.tv_letter, false);
        }
        if (bean.isCheck()) {
            holder.setTextColorRes(R.id.tv_city_name, R.color.colorFFFF7900);
        } else {
            holder.setTextColorRes(R.id.tv_city_name, R.color.colorFF030303);
        }
    }
}
